package ccrClasses.layer1.medications;

import java.util.ArrayList;
import java.util.List;

import ccrClasses.CCR;
import ccrClasses.ICcr;

public class Medications extends CCR implements ICcr {
	
	public static final String OPEN_TAG = "<Medications>";

	public static final String CLOSE_TAG = "</Medications>";
	
	private List<Medication> medications;

	public Medications() {
		super();
		medications = new ArrayList<Medication>();
	}

	@Override
	public String constructCcrString() {
		String ccr = BASE_OPEN_TAG + BODY_OPEN_TAG + OPEN_TAG;
		for(Medication i: medications){
			ccr = ccr + i.constructCcrString();
		}
		
		ccr = ccr + CLOSE_TAG + BODY_CLOSE_TAG + BASE_CLOSE_TAG;
		return ccr;
	}

	/**
	 * @return the medications
	 */
	public List<Medication> getMedications() {
		return medications;
	}

	/**
	 * @param medications the medications to set
	 */
	public void setMedications(List<Medication> medications) {
		this.medications = medications;
	}

}
